import base64
import numpy as np
import cv2
import hashlib


def file_md5(filepath):
	with open(filepath, 'rb') as f:
		data = f.read()
		md5_obj = hashlib.md5()
		md5_obj.update(data)
		code = md5_obj.hexdigest()
	return str(code).lower()


def file_to_base64(filepath):
    with open(filepath, 'rb') as f:
        data = f.read()
        data_b64 = base64.b64encode(data).decode()
    return data_b64


def base64_to_image(b64_data):
    pass
